<template>
  <div class="container enroll">
    <div class="enroll-match">
      <van-cell-group :border="false">
        <van-cell
          title="需求发布中心"
          center
          label="有需要从这里开始"
          :border="false"
          custom-class="linear-blue enroll-match-cell"
          value-class="enroll-match-logo"
        >
          <image
            :src="logo"
            mode="aspectFit"
          ></image>
        </van-cell>
      </van-cell-group>
    </div>
    <div class="enroll-switch">
      <van-cell-group
        custom-class="enroll-switch-group"
        :border="false"
      >
        <van-cell
          :icon="item.thumb"
          :title="item.title"
          center
          clickable
          :label="item.description"
          :url="item.link"
          v-for="(item,index) in type"
          :key="index"
          :border="false"
          custom-class="enroll-switch-cell"
          value-class="flex-none"
        >
          <van-icon
            slot="right-icon"
            :name="item.right"
            class="custom-icon"
          />
        </van-cell>
      </van-cell-group>
    </div>
  </div>
</template>

<script>
import navbar from '@/components/navbar'
import card from '@/components/card'
export default {
  components: {
    navbar,
    card
  },

  data () {
    return {
      id: 0,
      title: '导航栏',
      titleColor: '#000000',
      value: '',
      logo: '/static/images/eventlogo.png',
      type: [
        {
          title: '创建新需求',
          thumb: '/static/icons/history.png',
          description: '快速发布需求信息',
          right: 'add-o',
          link: '/pages/publish/main'
        },
        {
          title: '需求动态',
          thumb: '/static/icons/dynamic.png',
          description: '最近没有需求的变动消息',
          right: 'aim',
          link: '/pages/enroll/entryform/main?id=1&type=foreign'
        }
      ]
    }
  },
  onLoad (option) {
    this.id = option.id
    console.log(option)
    console.log('小程序 [page-blog] 生命周期: onLoad: 监听页面加载')
  },
  // 跳转后页面
  mounted () {
    console.log(this.id)
  },
  created () {
    console.log('enroll created')
  },
  methods: {
    onSearch () {
      console.log('test')
      console.log(this.value)
    }
  }
}
</script>

<style lang="less">
.search-warp {
  text-align: center;
  margin-top: 100px;
}
.enroll-switch {
  .van-cell__left-icon {
    line-height: initial !important;
  }
  &-group {
    padding: 15px;
  }
  &-cell {
    border-radius: 5px;
    margin-bottom: 15px;
    padding: 20px !important;
    font-size: 18px !important;
  }

  .van-cell__left-icon-wrap {
    font-size: 40px;
    margin-right: 15px;
  }
}

.enroll-match-cell {
  padding: 20px 15px 20px 30px !important;
  color: #fff !important;
  .van-cell__title {
    font-size: 20px;
    font-weight: bold;
  }

  .van-cell__label {
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 300;
  }
}
.enroll-match-logo {
  flex: 0.5 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  image {
    width: 80px;
    height: 80px;
  }
}
</style>
